package com.learn.controller;

import com.learn.bean.Account;
import com.learn.dao.AccountDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class AccountController {
    
    // 按照MVC框架此处省略了service层
    @Autowired
    private AccountDao accountDao;
    
    @GetMapping("/query")
    public List<Account> query() {
        return accountDao.getAllAccounts();
    }
}
